#ifndef OSGAnimation_H
#define OSGAnimation_H

#include <osg/ref_ptr>
#include <osgGe/Vec3f>
#include <osgGe/Vec4>
#include <osg/MatrixTransform>

#include <osg/Group>

#include <OsgExTool/Export>


osg::ref_ptr<osg::MatrixTransform> OsgExTool_EXPORT createNormalArrowCallback(std::vector<osg::Vec3f> points, double angle, double h, double l, osg::Vec4 color);
osg::ref_ptr<osg::MatrixTransform> OsgExTool_EXPORT createSquareArrowCallback(std::vector<osg::Vec3f> points, double angle, double h, double l, osg::Vec4 color);
osg::ref_ptr<osg::MatrixTransform> OsgExTool_EXPORT createMatrixTransformCallback(std::vector<osg::Vec3f> points, double w, double h, osg::Vec4 color, bool isAnimation);
osg::ref_ptr<osg::MatrixTransform> OsgExTool_EXPORT createErectMatrixTransformCallback(std::vector<osg::Vec3f> points, double w, double h, osg::Vec4 color, bool isAnimation);
osg::ref_ptr<osg::MatrixTransform> OsgExTool_EXPORT createErectMatrixTransformCallback_(std::vector<osg::Vec3f> points, osg::Matrixd mvp, bool isAnimation = true);

osg::ref_ptr<osg::MatrixTransform> OsgExTool_EXPORT create3DtextCallback(std::vector<osg::Vec3f> points, std::string str, float size = 20, osg::Vec4 color = osg::Vec4(1.0, 0.0, 0.0, 1.0));

class OSGAnimation
{
public:
    OSGAnimation();

public:
	//
    void createAnimation(std::vector<osg::Vec3f> pointsx, int num, osg::Matrixd mvp, bool isanimation = true);

    void setRootGroup(osg::ref_ptr<osg::Group> group);

    void removeAnimation();

    void startAnimation() ;

    void stopAnimation () ;

    bool isAnimation()    ;

    void plotModel()      ;

private:

    osg::ref_ptr<osg::Group> grout_root_          ;

    osg::ref_ptr<osg::MatrixTransform> animation_ ;

    std::vector<osg::Vec3f> pointsx_              ;
    int num_;

    osg::Matrixd mvp_                             ;
};

#endif // OSGFEATURE_H
